package com.component.code;

import java.util.ArrayList;

import net.sf.json.JSONObject;

import com.component.mode.Button;
import com.component.mode.ReturnInfo;
import com.dictionary.DictionaryTabel;

@SuppressWarnings("serial")
public class Constant {
	public final static String Tishi_Connect_Fail = getTishiT("连接失效，请重新连接", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_GetJuLeiShouZhi_Fail = getTishiT("获取局内收支信息失败", 2, null);
	public final static String Tishi_Param_Error = getTishiT("参数错误", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_Room_Close = getTishiT("该房间暂时关闭,请稍后再试", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_GetPlayerInfo_Fail = getTishiT("获取玩家信息失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_JieSuanYanChi_Fail = getTishiT("结算延迟,请重新登录", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_InOtherGame = getTishiT("正在其它游戏中", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_JoinRoom_Fail = getTishiT("加入房间失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_ChangeDesk_Fail = getTishiT("换桌失败,请稍后再试", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_SecondLogin = getTishiT("您的账号在其它地方登录了,您被挤出游戏,请检查是否是本人行为", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_MoneyTooLow = getTishiT("金币不足", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	

	public final static String Tishi_MoneyException = getTishiT("金币异常", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	
	public final static String Tishi_KickRoom = getTishiT("您已经被请出房间啦", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_PutMj_Error = getTishiT("还有定张的牌没有打完哦", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_No_Seat = getTishiT("该房间已无空位置啦,请稍后再试", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_GetRoomInfo_FAILL = getTishiT("获取房间信息失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_GetVersionInfo_FAILL = getTishiT("获取版本信息失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_YesterRankInfo_FAILL = getTishiT("获得昨日排行信息失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	
	public final static String Tishi_MyAwardInfo_FAILL = getTishiT("获得个人中奖记录失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	
	public final static String Tishi_MyAwardInfoToday_FAILL = getTishiT("获得今日中奖记录失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_GetBagInfo_FAILL = getTishiT("获取背包信息失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_JoinRoomFail_noExist = getTishiT("加入房间失败,没有您要找的房间", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	public final static String Tishi_CreateDesk_InOtherRoom = getTishiT("您已经在其他房间中，暂不能创建房间。", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_GetJoinInfo_FAILL = getTishiT("获取加入信息失败,请重试", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_JieSan_SUCCESS = getTishiT("解散房间成功,因为游戏并未开始,我们将不收取任何费用", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_CannotJoinRoom_NOJieSan = getTishiT("您创建的房间还未解散,暂不能加入其他房间", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_PeoPleEnought = getTishiT("房间人数已满,请稍后再试", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	public final static String Tishi_No_Money_FuWuFei = getTishiT("创建房间失败,您的钱暂不够付服务费", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});
	
	public final static String Tishi_IntoJuSai_BiSai = getTishiT("本场玩家直接进入决赛", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_sure, null));
		}
	});
	
	public final static String Tishi_IntoJuSai_BiSai1 = getTishiT("恭喜您进入决赛!前2名都有奖励哦！", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_sure, null));
		}
	});
	
	public final static String Tishi_BaoMingFail_BiSai1 = getTishiT("报名失败", 1, new ArrayList<Button>() {
		{
			add(new Button(DictionaryTabel.tishiButton_returnHall, null));
		}
	});

	// 维护系统
	public final static String Tishi_Observer_Error = getTishiT("玩家已经退出桌子,请重新回到主页面选择", 2, null);
	public final static String Tishi_FREEOPENAWARD = getTishiT("您目前有免费开奖次数,暂不能做其它操作", 2, null);
	public final static String Tishi_FREE_INFO = getTishiT("恭喜您中了SCATTER,[FF0000]10次免费[-]摇奖即将开始", 2, null);
	public final static String Tishi_MoneyTooLow_NoBet = getTishiT("没有足够的金币去变更押注金额", 2, null);
	public final static String Tishi_JoinObserver_Success = getTishiT("加入观察桌子成功", 2, null);
	public final static String Tishi_JoinObserver_Fail = getTishiT("加入观察桌子失败", 2, null);
	public final static String Tishi_ExitObserver_Success = getTishiT("退出观察桌子成功", 2, null);
	public final static String Tishi_ExitObserver_Fail = getTishiT("退出观察桌子失败", 2, null);
	public final static String Tishi_RestartAnroid_Sucess = getTishiT("重启机器人成功", 2, null);
	public final static String Tishi_RestartAnroid_Fail = getTishiT("重启机器人失败", 2, null);
	public final static String Tishi_UserIsNotExist_ = getTishiT("用户不存在", 2, null);
	public final static String Tishi_UserOrPassword_Error = getTishiT("账号或密码错误", 2, null);
	public final static String Tishi_ModifyDianKong_Fail = getTishiT("修改失败,此条点控信息正在使用中", 2, null);
	public final static String Tishi_Close_Success = getTishiT("关闭成功", 2, null);
	public final static String Tishi_Close_Fail = getTishiT("关闭房间失败", 2, null);
	public final static String Tishi_IllegalRquest = getTishiT("非法请求", 2, null);
	public final static String Tishi_Open_Success = getTishiT("开启成功", 2, null);
	public final static String Tishi_Open_Fail = getTishiT("开启失败", 2, null);
	public final static String Tishi_Add_Success = getTishiT("添加成功", 2, null);
	public final static String Tishi_Add_Fail = getTishiT("添加失败", 2, null);
	public final static String Tishi_Delete_Success = getTishiT("删除成功", 2, null);
	public final static String Tishi_Delete_Fail = getTishiT("删除失败", 2, null);
	public final static String Tishi_Modity_Success = getTishiT("修改成功", 2, null);
	public final static String Tishi_Modity_Fail = getTishiT("修改失败", 2, null);
	public final static String Tishi_Search_Fail = getTishiT("查询失败", 2, null);
	public final static String Tishi_Delete_Fail_DianKong = getTishiT("删除点控信息失败,此条点控信息正在使用中", 2, null);
	public final static String Tishi_JieSanDesk_Fail = getTishiT("解散桌子失败", 2, null);
	public final static String Tishi_Send_Success = getTishiT("发送成功", 2, null);
	public final static String Tishi_MoneyNo_Full = getTishiT("金币不足", 2, null);

	public static String getTishiT(String value, int type, ArrayList<Button> buttons) {
		ReturnInfo rInfo = new ReturnInfo();
		rInfo.setType(type);
		rInfo.setInfo(value);

		if (buttons != null) {
			for (int i = 0; i < buttons.size(); i++) {
				Button button = buttons.get(i);
				rInfo.addButton(button);
			}
		}
		return JSONObject.fromObject(rInfo).toString();
	}

}
